<?php
/**
 * 用户登录
 * @author solar
 */
require_once PATH_API.'/service/UserService.php';

class AuthProxy extends AbstractProxy
{
	public function noAuthMethod() {
		return array('login');
	} 
	
	/**
	 * 登录
	 * @author solar
	 */
	public function login() {
		if(UserService::login($_POST['name'],$_POST['pwd'])) $this->out['result']=1;
		else $this->out['result']=0;
		return $this->out;		
	}
	
	/**
	 * 登出
	 * @author solar
	 */
	public function logout() {
		UserService::logout();
		$this->out['result']=1;
		return $this->out;
	}
	
	/**
	 * 是否已登录
	 * @author solar
	 */
	public function logined() {
		$this->out['result']=UserService::isLogined() ? 1 : 0;
		return $this->out;
	}
}

?>